﻿using System;
using System.Collections;
using System.Collections.Generic;

using System.Text;

using IBatisNet.Common;
using IBatisNet.DataMapper;
using IBatisNet.DataMapper.Configuration;
using IBatisNet.Common.Utilities;
using IBatisNet.DataAccess;
using IBatisNet.DataAccess.Configuration;
using IBatisNet.DataAccess.Interfaces;
using IBatisNet.Common.Logging;

//using MT.eVotePRS.Persistence.Interface;
//using MT.eVotePRS.Persistence.MapperDao;
using MT.eVotePRS.Model;

namespace MT.eVotePRS.Service
{
    public class StudentsService
    {
        private static StudentsService _getStudentService = new StudentsService();
        private IDaoManager _getDaoManager = null;
        //private IStudentsDao _getbaseService = null;
        public static SqlMapper _getsqlmaper = null;

        public StudentsService()
        {
            //#region Define the Base Map
            //_getDaoManager = ServiceConfig.GetInstance().DaoManager;
            //if (_getDaoManager != null)
            //    _getbaseService = _getDaoManager.GetDao(typeof(StudentsMapDao)) as IStudentsDao;
            //#endregion

            #region Use SqlMaper Style to Solve this Connection Problem

            DomSqlMapBuilder getbuilder = new DomSqlMapBuilder();
            if (getbuilder != null)
                _getsqlmaper = getbuilder.Configure() as SqlMapper;
            #endregion

        }

        #region IBaseService Members

        public void InsertOperator(Model.Students student)
        {
            #region Define the Base Insert Operator By ServiceConfig
            //_getDaoManager.BeginTransaction();
            //try
            //{
            //    _getbaseService.InsertOperator(student);
            //    _getDaoManager.CommitTransaction();
            //}
            //catch
            //{
            //    _getDaoManager.RollBackTransaction();
            //    throw;
            //}
            #endregion


            #region the Base Handle
            //if (_getsqlmaper != null)
            //{
            //    _getsqlmaper.BeginTransaction();
            //    try
            //    {
            //        _getsqlmaper.Insert("InsertStudent", getcustomer);
            //        _getsqlmaper.CommitTransaction();
            //    }
            //    catch
            //    {
            //        _getsqlmaper.RollBackTransaction();
            //        throw;
            //    }
            //}
            #endregion
        }

        public void DeleteOperator(int customerId)
        {
            throw new NotImplementedException();
        }

        public void UpdateOperator(Model.Students student, int studentId)
        {
            throw new NotImplementedException();
        }

        public void QueryOperator(int customerid)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
